﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace APACWP8.View
{
    public partial class PanoramaPage4 : PhoneApplicationPage
    {
        public PanoramaPage4()
        {
            InitializeComponent();
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            CheckOrientation(LayoutRoot);
        }
        private void CheckOrientation(Grid content)
        {

            if ((Orientation & PageOrientation.Portrait) == (PageOrientation.Portrait))
            {
                content.Margin = new Thickness(0, 0, 0, 0);
            }
            else if ((Orientation & PageOrientation.LandscapeLeft) == (PageOrientation.LandscapeLeft))
            {
                content.Margin = new Thickness(0, 0, 36, 0);
            }
            else if ((Orientation & PageOrientation.LandscapeRight) == (PageOrientation.LandscapeRight))
            {
                content.Margin = new Thickness(36, 0, 0, 0);
            }
        }
        private async void TextBlock_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/AREA/APAC/APACRegion/Pages/default.aspx"));
        }

        private async void TextBlock_Tap_2(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/CentralizedFunctions/Finance/PROCUREMENT/PurchasingSpending/5PayingPurchasing/Pages/PROCUR 5 14 Global Travel Policy.aspx"));
        }

        private async void TextBlock_Tap_3(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await Windows.System.Launcher.LaunchUriAsync(new Uri("https://microsoft.sharepoint.com/sites/mspolicy/CentralizedFunctions/Finance/PROCUREMENT/PurchasingSpending/5PayingPurchasing/Pages/PROCUR 5 15 Global Expense Policy.aspx"));

        }
        private void SettingClick_Click(object sender, EventArgs e)
        {
            App.RootFrame.Navigate(new Uri("/View/SettingPage.xaml", UriKind.Relative));
        }

        private void SearchClick_Click(object sender, EventArgs e)
        {
            App.RootFrame.Navigate(new Uri("/View/SearchPage.xaml", UriKind.Relative));
        }
    }
}